package com.central.scheduler.dao.mapper;

import com.central.db.mapper.SuperMapper;
import com.central.scheduler.dao.model.Command;
import com.central.scheduler.dao.entity.CommandCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author Tindy
 * @date 2021/11/1
 * @describe
 */
@Mapper
public interface CommandMapper  extends SuperMapper<Command> {
    /**
     * count command state
     * @param userId userId
     * @param startTime startTime
     * @param endTime endTime
     * @param proIds proIds
     * @return CommandCount list
     */
    List<CommandCount> countCommandState(
            @Param("userId") int userId,
            @Param("startTime") Date startTime,
            @Param("endTime") Date endTime,
            @Param("proIds") Long[] proIds);

    /**
     * query command page
     * @return
     */
    List<Command> queryCommandPage(@Param("limit") int limit, @Param("offset") int offset);

}
